<template>
    <div class="sidebaritem-wraper">
        <template v-if="item.children && item.children.length > 0" >
            <el-submenu ref="subMenu" :index="item.name">
                <template slot="title">
                    <i :class="item.icon"></i>
                    <span>{{item.title}}</span>
                </template>
                <sidebar-item
                        v-for="child in item.children"
                        :key="child.path"
                        :item="child"
                />
            </el-submenu>
        </template>
        <template v-else>
            <el-menu-item :index="item.name">
                <i :class="item.icon"></i>
                <span slot="title">{{item.title}}</span>
            </el-menu-item>
        </template>
    </div>
</template>

<script>
    export default {
        name: "sidebarItem",
        props: {
            item: {
                type: Object,
                required: true
            }
        },
        methods: {
        }
    }
</script>

<style scoped lang="less">
</style>
